<?php 


namespace app\admin\model;

use app\common\model\BaseModel;
use think\Model;

class Product extends BaseModel {

    const   IS_INTEGALPURCHASE_1 = 1;  //是否积分购买1=不支持积分换购 2=支持积分换购
    const   IS_INTEGALPURCHASE_2 = 2;

    public function getIntegralProduct(){
        return $this->hasOne('integralproducts',"productId","id");
    }
    public function getProduct($param){
        return  self::alias('a')->join('productdetail b','a.id=b.productId')->where('id','=',$param->productId)->find();
    }

}